package cn.xiangxu.com.webclient_rest_client.rest_server_api;

import cn.xiangxu.com.webclient_rest_client.proxy.RestApi;
import cn.xiangxu.com.webclient_rest_client.proxy.Student;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * @author 王杨帅
 * @create 2018-08-23 22:18
 * @desc
 **/
@RestApi(value = "http://127.0.0.1:8080/stu")
public interface IStudentApi {

    @GetMapping(value = "/")
    Flux<Student> listStudent();

    @GetMapping(value = "/{id}")
    Mono<Student> getStudent(
            @PathVariable(value = "id") String studentId
    );

    @DeleteMapping(value = "/{id}")
    Mono<String> deleteStudent(@PathVariable(value = "id") String studentId);

    @PutMapping(value = "/")
    Mono<String> updateStudent(@RequestBody Mono<Student> student);

    @PostMapping(value = "/")
    Mono<String> createStudent(@RequestBody Mono<Student> studentDO);

    @GetMapping(value = "/testNotFound/info")
    Mono<String> testNotFound();

}
